<?php

// Created by Khanh Nam
class LocationMenu extends CWidget{
    public $model;
    private $contacts;
    private $customer;
    public function init(){
        $this->customer=Customers::model()->find('custno=:custno',array(
            'custno'=>$this->model->custno,
        ));
        echo $this->model->locno;
        $this->contacts=Locationcontacts::model()->findAll(array(
            'condition'=>'custno=:custno AND locno=:locno',
            'params'=>array(
                'custno'=>$this->model->custno,
                'locno'=>$this->model->locno,
            ),            
        ));
        
        
    }
    public function run(){
        
        $this->render('application.components.view.LocationMenu',array(
            'contacts'=>$this->contacts,
            'customer'=>$this->customer,
        ));
    }
}
?>
